package com.jic.market.enums;

/**
 * description: PromotionLimitRuleLimitTypeEnum
 * date: 2020/2/29 17:44
 * author: wangys
 * version: 1.0
 */
public enum PromotionLimitRuleLimitTypeEnum {
    SPU_TYPE(5,"spu"),
    SKU_TYPE(3,"sku"),

    ;
    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    PromotionLimitRuleLimitTypeEnum(Integer type, String name) {
        this.code = type;
        this.name = name;
    }
    public static PromotionLimitRuleLimitTypeEnum lookByFrontType(Integer code){
        if(code == null){
            return null;
        }
        for (PromotionLimitRuleLimitTypeEnum value : PromotionLimitRuleLimitTypeEnum.values()) {
            if(value.code.equals(code)){
                return value;
            }
        }
        return null;
    }
}
